#!/usr/bin/env bats

@test "static no-color: static (when dynamic is the same as static, nothing happens)" {
  cd $BATS_TEST_DIRNAME
  expected="file1:23:to his commits. This ID allows Gerrit to link together different versions of
file1:57:The output of this command also contains a link to a web page Max can use to
file1:58:review this commit. Clicking on that link takes him to a screen similar to the"
  result="$(fish -c 'tbgs link')"; [ "$result" = "$expected" ]
  result="$(fish -c 'tbgs link no-color')"; [ "$result" = "$expected" ]
  result="$(fish -c 'tbgs no-color link')"; [ "$result" = "$expected" ]
}

@test "static no-color: dynamic overwrites static" {
  cd $BATS_TEST_DIRNAME
  expected="file1:23:to his commits. This ID allows Gerrit to [01;31m[Klink[m[K together different versions of
file1:57:The output of this command also contains a [01;31m[Klink[m[K to a web page Max can use to
file1:58:review this commit. Clicking on that [01;31m[Klink[m[K takes him to a screen similar to the"
  result="$(fish -c 'tbgs color link')";  [ "$result" = "$expected" ]
  result="$(fish -c 'tbgs link color')";  [ "$result" = "$expected" ]
}
